
#ifndef LOD_TVERTEX_H
#define LOD_TVERTEX_H

#include <vector>
#include "vertex.h"
#include "tv_iface.h"

//! Triangles-aware vertex
//
/*! This type of a vertex has an information about triangles that it belongs to.
 * \param co_type A type used to represent vertex'es coordinates.
 * \param it_type A type used to represent indices of the triangles.*/
template<class co_type, class it_type>
class tvertex : public vertex<co_type>, public tv_iface<it_type>
{
    public:
    
    /*!
     * \param c Coordinates of the vertex.
     * \param n Coordinates of the normal vector. */
    tvertex(const co_type* c, const co_type* n)
     : vertex<co_type>(c, n)
    {
    }

    tvertex()
    {
    }


    /*! 
     * \param tv A tvertex to compare this one with.*/
    bool operator== (const tvertex & tv) const
    {
            // compare using methods from the base classes
       return ((vertex<co_type>*)this)->operator==(tv) &&
               ((tv_iface<it_type>*)this)->operator==(tv);
    }
};

#endif // LOD_TVERTEX_H
